define(()=>{
    return function(box, res){
        let str = "";
        res.forEach(val=>{
            str += `<div class="box" index="${val.proId}">
                        <a href="./goods.html?id=${val.proId}">
                        <img src="${val.img}" alt="">
                        <p>${val.proName}</p></a>
                        <p class="price"><b>原价</b>：<span>${val.price}</span> <b>现价</b>：<span>${(val.price * val.discount / 10).toFixed(1)}</span></p>
                        <p>销量：<span>${val.sales}</span></p>
                        <input type="button" value="加入购物车" class="add">
                    </div>`;
        })
        box.html(str);
    }
})